package com.kws.merchant.controller;


import com.kws.merchant.domain.OperationWorkOrder;
import com.kws.merchant.domain.po.OperationWorkDisposePo;
import com.kws.merchant.domain.po.OperationWorkOrderPo;
import com.kws.merchant.service.OperationWorkOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import com.kws.common.core.domain.R;

import javax.annotation.Resource;
import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * 运维-工单管理(OperationWorkOrder)表控制层
 *
 * @author yxy
 * @since 2024-10-26 12:27:15
 */
@RestController
@Api(tags = "运维-工单管理(OperationWorkOrder)")
@RequestMapping("operationWorkOrder")
public class OperationWorkOrderController {
    /**
     * 服务对象
     */
    @Resource
    private OperationWorkOrderService operationWorkOrderService;


    @PostMapping("/page")
    @ApiOperation(value = "分页查询列表")
    public R<Page<OperationWorkOrder>> pageList(@RequestBody OperationWorkOrderPo operationWorkOrderPo) {
        return R.ok(operationWorkOrderService.pageList(operationWorkOrderPo));
    }


    @GetMapping("/detailById/{id}")
    @ApiOperation(value = "通过主键查询单条数据")
    public R<OperationWorkOrder> detailById(@PathVariable Long id) {
        return R.ok(operationWorkOrderService.detailById(id));
    }


    @PostMapping("/addWorkOrder")
    @ApiOperation(value = "新增工单")
    public R addWorkOrder(@RequestBody OperationWorkOrder operationWorkOrder) {
        return R.ok(operationWorkOrderService.addWorkOrder(operationWorkOrder));
    }

    @PostMapping("/dispose")
    @ApiOperation(value = "工单处理")
    public R dispose(@RequestBody OperationWorkOrder operationWorkOrder) {
        return R.ok(operationWorkOrderService.dispose(operationWorkOrder));
    }


}
